<?php
namespace Admin\Model;
use Think\Model;

class ConfigModel extends Model {
    protected $_validate = array(
        array('keyword', 'require', '关键字不能为空', self::EXISTS_VALIDATE, 'regex', self::MODEL_BOTH),
        array('keyword', '', '关键字已经存在', self::VALUE_VALIDATE, 'unique', self::MODEL_BOTH),
        array('name', 'require', '规则名称不能为空', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
        array('content', 'require', '回复内容不能为空', self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
    );

    protected $_auto = array(
    	array('content', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('count', '0', self::MODEL_INSERT),
        array('status', '1', self::MODEL_INSERT)
    );
}
?>